/**
 * @author Fayçal INAJJARANE
 */
package com.appspot.finajjarane.framework.service;

import javax.servlet.http.HttpServletRequest;

import com.appspot.finajjarane.framework.models.ArticleModel;
import com.google.appengine.api.blobstore.BlobKey;
import com.google.appengine.api.images.Image;

public interface IImageService {

	/**
	 * Get the image of the specific Article
	 * @param article
	 * @return image
	 */
	public Image getImageByArticle(ArticleModel article);


	/**
	 * Create an url to allow upload image
	 * @param baseUrl
	 * @return url to set in form action
	 */
	public String createUploadUrl(String baseUrl);


	/**
	 * Upload an image and get it's blobKey
	 * @param article
	 * @return the blobKey of the uploaded image
	 */
	public BlobKey uploadImageForArticle(ArticleModel article);


	/**
	 * Get image key juste uploaded
	 * @param request
	 * @param fileFormName name of the input file in form
	 * @return the blobKey String of the uploaded image
	 */
	public String getImageKeyUploaded(HttpServletRequest request, String fileFormName);


}
